
var account = document.getElementsByClassName("account");
var password = document.getElementsByClassName("password");
var recorde = document.getElementsByClassName("recorde");
account[0].onclick = function(){
    account[0].style.border = "1px solid #1c77c3";
    ap1[0].classList.add("hide");
    erra[0].classList.add("hide");
}
password[0].onclick = function(){
    password[0].style.border = "1px solid #1c77c3";
    bp1[0].classList.add("hide");
    errb[0].classList.add("hide");
}


var stud = document.getElementsByClassName("stud");
var teach = document.getElementsByClassName("teach");

$(function(){          //点击其他地方，当前块div效果消失
    $(document).bind("click",function(e){
    var target  = $(e.target);
        if(target.closest(".stud").length == 0 && fname.value != ""){
  　　　    if(target.closest(".account").length == 0 ){
      　　　    $(".account")[0].style.border = "1px solid #a7a7a7";
 　　　     }
        }　　　　
 　 })
})            

$(function(){
    $(document).bind("click",function(e){
    var target  = $(e.target);
        if(target.closest(".stud").length == 0 && lname.value != ""){
  　　　    if(target.closest(".password").length == 0 ){
      　　　    $(".password")[0].style.border = "1px solid #a7a7a7";
 　　　     }　　　　
        }
 　 })
})




var stud = document.getElementsByClassName("stud");
var fname = document.getElementById("fname");
var lname = document.getElementById("lname");
var ap1 = document.getElementsByClassName("hint_ap1");
var bp1 = document.getElementsByClassName("hint_bp1");
var erra = document.getElementsByClassName("erra");
var errb = document.getElementsByClassName("errb");
stud[0].onclick = function(){
    if(fname.value == ""){
        ap1[0].classList.remove("hide");
        erra[0].classList.remove("hide");
        account[0].style.border = "1px solid red";
    }
    else{
        ap1[0].classList.add("hide");
        erra[0].classList.add("hide");
        account[0].style.border = "1px solid #a7a7a7";
    }
    
    if(lname.value == ""){
        bp1[0].classList.remove("hide");
        errb[0].classList.remove("hide");
        password[0].style.border = "1px solid red";
    }
    else{
        bp1[0].classList.add("hide");
        errb[0].classList.add("hide");
        password[0].style.border = "1px solid #a7a7a7";
    }
}


$(function(){          //点击其他地方，当前块div效果消失
    $(document).bind("click",function(e){
    var target  = $(e.target);
        if(target.closest(".recorde").length != 0 && lname.value != ""){
            if(target.closest(".account").length == 0 && target.closest(".password").length == 0){
                if(fname.value == ""){
  　　　            ap1[0].classList.remove("hide");
                    erra[0].classList.remove("hide");
                    account[0].style.border = "1px solid red";
                }　　
                else{
                    ap1[0].classList.add("hide");
                    erra[0].classList.add("hide");
                    account[0].style.border = "1px solid #a7a7a7";
                }　　
            }
        }
 　 })
}) 

$(function(){
    $(document).bind("click",function(e){
    var target  = $(e.target);
        if(target.closest(".recorde").length != 0 && fname.value != ""){
            if(target.closest(".password").length == 0 && target.closest(".account").length == 0){
                if(lname.value == ""){
                    bp1[0].classList.remove("hide");
                    errb[0].classList.remove("hide");
                    password[0].style.border = "1px solid red";
                }
                else{
                    bp1[0].classList.add("hide");
                    errb[0].classList.add("hide");
                    password[0].style.border = "1px solid #a7a7a7";
                }
            }
        }
 　 })
})


var teach = document.getElementsByClassName("teach");
teach[0].onclick = function(){
    window.location.href="http://zycon.denengda.com";
}




